package edu.scdx.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import edu.scdx.dao.GoodsMapper;
import edu.scdx.dao.UserInfoMapper;
import edu.scdx.dao.UserMapper;
import edu.scdx.entity.Goods;

@Service
public class GoodsServiceImpl implements GoodsService {
	
	@Autowired
    private GoodsMapper goodsMapper;

	public GoodsMapper getGoodsMapper() {
		return goodsMapper;
	}

	public void setGoodsMapper(GoodsMapper goodsMapper) {
		this.goodsMapper = goodsMapper;
	}

	@Override
	public List<Goods> getAll() {
		
		return goodsMapper.getAll();
		
	}

	@Override
	public Goods getGoodById(int id) {
		
		Goods good=goodsMapper.getGoodById( id);
		return good;
	}

	@Override
	public List<Goods> getAllWenxue(String wenxue) {
		
		return goodsMapper.getAllWenxue(wenxue);
		
	}

	@Override
	public List<Goods> getAllSheke(String sheke) {

		return goodsMapper.getAllSheke(sheke);
		
	}

	@Override
	public List<Goods> getAllErtong(String ertong) {
		
		return goodsMapper.getAllErtong(ertong);
		
	}

	@Override
	public List<Goods> getAllJiaoxue(String jiaoxue) {
		
		return goodsMapper.getAllJiaoxue(jiaoxue);
		
	}

	@Override
	public List<Goods> getGoodsByName(String name) {
		
		return goodsMapper.getGoodsByName(name);
		
	}

	@Override
	public void addGoods(String name, String author, String type, String publisher, Double price, String description,
			Double kou) {
		
		goodsMapper.addGoods(name,author,type,publisher,price,description,kou);
		
	}

	
	
	

}
